<div class="style-list clearfix" id="editor-style-{{$item['id']}}"><!-- start style-list -->
		<div class="content" >
			{{if $item['cate_id']>=50}}
				<div class="text-center"><!-- image resource -->
				<?PHP 
					if($item['coverimg']){
					echo $this->Html->image($item['coverimg'], array('title'=>$item['name'],'class'=>'lazy','style'=>'max-width:100%;',));
				}
				?>
				</div>
			{{else}}
				{{if $item['cate_id']==3 }} <!-- template && $item['coverimg'] -->
						<div class="pr">
							{{$this->Html->image($item['coverimg'],array('title'=>$item['name'],'class'=>'template-cover','data-id'=>$item['id'],'style'=>'max-width:100%;min-height:200px;','data-src'=>$item['coverimg'],))}}
							{{if $item['creator']==$CurrentUser['id'] && $item['status']!=1}}
							<a class="btn btn-xs" style="position:absolute;bottom:5px;right:10px;color:rgb(255, 129, 36);" href="javascript:;" title="{{__('Delete This Template')}}" onclick="if(confirm('{{__('Are you sure to delete?')}}')) return ajaxAction('{{$this->Html->url('/editor_styles/delete/'.$item['id'])}}',null,null,function(request){$('#editor-style-'+request.id).remove()});">
									<i class="fa fa-trash"></i>
							</a>
							{{/if}}
						</div>
						<div class="editor-style-content hidden" {{if !$unuse_data_id}}data-id="{{$item['id']}}"{{/if}}  data-name="{{htmlspecialchars($item['name'])}}" id="template-{{$item['id']}}">
					<?php
						$content = preg_replace('/class="\w+"/is','',$item['content']);
						$content = preg_replace('/data-\w+="\w+"/is','',$content);
						echo $content;
					?>

						</div>
				{{else}}
					<div class="editor-style-content  clearfix" {{if !$unuse_data_id}}data-id="{{$item['id']}}"{{/if}} data-name="{{htmlspecialchars($item['name'])}}" id="template-{{$item['id']}}">
					<?php
						$content = preg_replace('/class="\w+"/is','',$item['content']);
						$content = preg_replace('/data-\w+="\w+"/is','',$content);
						echo $content;
					?>
				</div>
				{{/if}}
			{{/if}}
		</div><!-- end content -->
		<?php  
if($item['cate_id']>=50)
	$tooltip = __('EditorStyle Image Favorite Tips');
elseif($item['cate_id']==3)
	$tooltip = __('EditorStyle Template Favorite Tips');
else
	$tooltip = __('EditorStyle Style Favorite Tips');
 ?>
			<div class="tools clearfix">
				<div class="title">
					<span><a href="{{$this->Html->url('/editor_styles/'.date('Ymd',strtotime($item['created'])).'/'.$item['id'].'.html')}}" target="_blank">{{$item['name']}}</a></span>
					<!--<span><span class="ui-stats-num" id="Stats-EditorStyle-{{$item['id']}}-view_nums">{{$item['view_nums']}}</span></span>-->
					{{if $item['price'] == 0}}
						{{if $fovarited_list && $favor_id = array_search($item['id'],$fovarited_list)}}
							
							<a href="javascript:void(0)"  data-toggle="tooltip" data-container="body" data-placement="top"  class="btn-unfavorite btn-red pull-right" data-url="{{$this->Html->url('/favorites/cancel/'.$favor_id)}}" data-id="{{$item['id']}}" title="{{__('Favorited Tips')}}" onclick="unfavorite(this);"><i class="fa fa-heart"></i>  <span style="font-size:13px;line-height:24px;">{{__('Favorited')}}(<span class="ui-stats-num" id="Stats-EditorStyle-{{$item['id']}}-favor_nums">{{$item['favor_nums']}}</span>)</span></a>
							<a class="btn-fav-refresh btn-red pull-right" style="margin:0 10px;" href="javascript:;"
data-url="{{$this->Html->url('/favorites/refresh/'.$favor_id)}}" onclick="return refreshfavorite(this);"><i class="fa fa-arrow-up" data-toggle="tooltip" data-container="body" data-placement="top" title="收藏的找不到了？点击移到最前面"></i>
											</a>
											
						{{else}}
							<a href="javascript:void(0)"  data-toggle="tooltip" data-container="body" data-placement="top"  class="btn-favorite btn-red  pull-right" data-model="EditorStyle" data-id="{{$item['id']}}" title="{{$tooltip}}" onclick="addtofavor('EditorStyle',{{$item['id']}},this);"><i class="fa fa-heart-o"></i> <span style="font-size:13px;line-height:24px;">{{__('Favorite')}}(<span class="ui-stats-num" id="Stats-EditorStyle-{{$item['id']}}-favor_nums">{{$item['favor_nums']}}</span>)</span></a>
						{{/if}}
						{{if $item['score']}}
							<span class="pull-right"  data-toggle="tooltip" data-container="body" data-placement="top" style="color:red;margin:0 5px" title="收藏所需积分"><i class="fa fa-leaf"></i>{{$item['score']}}</span>
						{{/if}}
					{{/if}}
				</div>

				{{if $item['price'] > 0}}
					{{if $fovarited_list && $favor_id = array_search($item['id'],$fovarited_list)}}
						<p style="clear:both;line-height:42px;margin-top:10px">
							<a class="btn btn-default pull-right"
				 onclick="javascript:void(0)" disabled href="javascript:void(0)">已购买</a>
				 			<span class="product-price">{{format_price($item['price'])}}</span>
						</p>
					{{else}}
						<p style="clear:both;line-height:42px;margin-top:10px">
							<a aria-disabled="false" class="btn btn-warning btn-sm pull-right" style="color:#FFF;"
				 onclick="return directBuy({{$item['id']}},1,'EditorStyle');" href="javascript:void(0)">{{__('Buy Directly')}}</a>
				 			<span class="product-price">{{format_price($item['price'])}}</span>
						</p>
					{{/if}}
				{{/if}}
				
				{{if !empty($_SESSION['Auth']['Staff']) }}
					<div style="margin-top:10px;">
						{{if 0 && $data_tags[$item['id']]}}
							<p style="margin: 5px 0 0;">
							{{loop $data_tags[$item['id']] $tid}}
								<a class="label label-info" href="/tags/lists/EditorStyle/{{$tid}}?EditorStyle.cate_id={{$item['cate_id']}}" target="_blank">{{$all_tags[$tid]}}</a> &nbsp;
							{{/loop}}
							</p>
						{{/if}}
						<p>
			    		<a class="btn btn-primary btn-xs" href="{{Router::url('/admin/'.$category_control_name.'/edit/'.$item['id'])}}" target="_blank"><i class="glyphicon glyphicon-edit"></i>{{lang('edit')}}</a>
			    		{{if $item['recommend']}}
			    			&nbsp;&nbsp;<label class="label label-default">已推荐</label
			    		{{/if}}
			    		</p>
			    	</div>
			    {{/if}}   
			</div><!-- end tools -->
</div><!-- end style-list -->
